<?php

namespace Mobi\Controller;

use Think\Controller;

class SopsController extends Controller
{
    public function index()
    {
        $region = M("region", "so_", "STOC");

        $this->assign("pro", $region->where("ren_parent=1")->select());

        $this->display();
    }

    public function getrenchild()
    {
        $region = M("region", "so_", "STOC");
        $id = I("post.id");
        $list = $region->where("ren_parent=" . $id)->select();
        $this->ajaxReturn($list);
    }
    
    public function addmailname()
    {
        $mailist = M("mailist", "so_", "STOC");
        if (!$mailist->create()) {
            $this->error($mailist->getError());
        }
        $mailist->ma_time=time();
        if ($mailist->add()) {
            $this->success("申请成功");
        } else {
            $this->error("申请失败，请重新申请");
        }
    }
}
